<template>
  <div class="discbox">
    <div class="discbox-header mb-12">候选人的行为风格在四个象限中的分布:</div>
    <div class="discbox-body">
      <div class="discbox-bodyitem">
        <div class="discbox-bodyitembox" v-for="(item,index) in dataLiat" :key="index">
          <div class="discbox-bodyitemboxcenter">
            <div class="f-14 bold">{{ item.title }}</div>
            <div class="f-14 mt-8">{{ item.desc }}</div>
            <div class="f-14 mt-12">{{ getBaibi(item) }}</div>
          </div>
        </div> 
      </div> 
    </div>
  </div>
</template>

<script setup>
import { defineProps, ref } from 'vue';
const props = defineProps({
  data: {
    type: Object,
    default: () => {}
  }
})

const dataLiat = ref([
  {
    title:'支配型(D)',
    desc: '直接、果断、结果导向'
  },
  {
    title:'影响型(I)',
    desc: '热情、乐观、社交型'
  },
  {
    title:'稳健型(S)',
    desc: '耐心、可靠、合作型'
  },
  {
    title:'谨慎型(C)',
    desc: '精确、分析、质量导向'
  }
])

const getBaibi = (item) => {
  const tempdata = props.data.disc_behavioral_assessment.find(e => item.title == e.name)
  return tempdata?.score + "%"
}

</script>

<style lang="scss" scoped>
.discbox{
  &-footer{
    display:flex;
    flex-direction: column;
    align-items: center;
  }
  &-body{
   
  }
  &-bodyitem{
    display:flex;
    border: #000 1px solid;
    flex-wrap: wrap;
    border-bottom: none;
  }
  &-bodyitembox{
    flex: 0 0 auto;
    width: 50%;
    position: relative; 
    border-bottom: #000 1px solid;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    height: 120px;
  }

  &-bodyitembox:first-child{
    background: #fdedeb;
  }

  &-bodyitembox:nth-child(2n){
    background: #eaf4fb;
  }

  &-bodyitembox:nth-child(3n){
    background: #eafaf1;
  }

  &-bodyitembox:nth-child(4n){
    background: #f5eef8;
  }
  &-bodyitembox::after{
    position: absolute;
    top:0;
    right: 0;
    bottom: 0;
    width: 1px;
    content: '';
    border-right: #000 1px solid;
  }
  &-bodyitembox:nth-child(2n){
    &::after{
      display: none;
    }
  }
  &-bodyitemboxcenter{
    padding: 12px;
  }
}
</style>